package com.ruoyi.web.api.controller.system;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.system.domain.SysAed;
import com.ruoyi.system.service.ISysAedService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * AED信息Controller
 *
 * @author ruoyi
 */
@Api(tags = "AED管理")
@RestController
@RequestMapping("/system/aed")
public class SysAedController extends BaseController {
    private final ISysAedService sysAedService;

    public SysAedController(ISysAedService sysAedService) {
        this.sysAedService = sysAedService;
    }

    /**
     * 查询AED信息列表
     */
    @ApiOperation(value = "获取AED列表", notes = "获取所有AED信息")
    @GetMapping("/list")
    public TableDataInfo list(SysAed sysAed) {
        startPage();
        List<SysAed> list = sysAedService.selectSysAedList(sysAed);
        return getDataTable(list);
    }


    /**
     * 获取AED信息详细信息
     */
    @ApiOperation(value = "获取AED详细信息", notes = "根据id获取AED详细信息")
    @ApiImplicitParam(name = "id", value = "AED ID", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        return success(sysAedService.selectSysAedById(id));
    }


}